<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/axios-0.18.0.js"></script>
    <script src="js/vue-v2.6.10.js"></script>
</head>
<body>
<div id="app">
    欢迎 {{user.realname}} 登录主页
</div>

</body>
</html>
<script>
    new Vue({
        el: "#app",
        data: {
            uuid:'',
            user:{}
        },
        methods: {
            initUser(){
                //从session中获取用户信息
                this.uuid = sessionStorage.getItem("uuid");
                //发送新的请求
                axios.get("http://127.0.0.1:8080/getUser",{
                    params:{
                        uuid : this.uuid,
                    }
                }).then(resp=>{
                    if(resp.status==200){
                        console.log(resp.data)
                        this.user = resp.data;
                    }
                })
            }
        },
        created(){
            this.initUser();
        }
    })
</script>